﻿using System;
using System.Collections.Generic;
using System.Text;

namespace designmodule.behavioralmodule.Mediator
{
    public abstract class Mediator
    {
        public abstract void Send(string message,Colleague colleague);
    }

    public class ConcreteMediator : Mediator
    {
        public ConcreteColleague1 ConcreteColleague1 { get; set; }
        public ConcreteColleague2 ConcreteColleague2 { get; set; }

        public override void Send(string message, Colleague colleague)
        {
            if (ConcreteColleague1==colleague)
            {
                ConcreteColleague2.Notify(message);
            }
            else
            {
                ConcreteColleague1.Notify(message);
            }
        }
    }
}
